Hello,
void removeLMDesc(void)
{
Folder fol = getParentFolder (archiveModule)
LinkModuleDescriptor linkModDesc = null
for linkModDesc in fol do {
string modSource = getSourceName(linkModDesc)
string modTarget = getTargetName(linkModDesc)
if (modSource == fullName(archiveModule))
{ removeLinkModuleDescriptor(fol, modSource,modTarget) }
}
}
DOORS: **** Translating a structured exception **** DOORS: Version 9.3.0.0, build number 93199, built on Sep 8 2010 17:09:51. DOORS: Whistler Workstation Service Pack 3 (Build 2600) DOORS: DOORS: 32 percent of memory is in use. DOORS: There are 1048048 total Kbytes of physical memory. DOORS: There are 705268 free Kbytes of physical memory. DOORS: There are 2151076 total Kbytes of paging file. DOORS: There are 1933656 free Kbytes of paging file. DOORS: There are 1fff80 total Kbytes of virtual memory. DOORS: There are 1c940c free Kbytes of virtual memory. DOORS: argv[0]: C:\Program Files\IBM\Rational\DOORS\9.3\bin\doors.exe DOORS: doors.exe caused an EXCEPTION_ACCESS_VIOLATION in module <UNKNOWN> at 001B:038F52AE DOORS: Stack trace string not available DOORS: 001B:004EDD68 (0x00000000 0x71EF0479 0x1000E4A6 0x1000E49B) doors.exe DOORS: 001B:0051D212 (0x0012EEF0 0x038F52B4 0x038F5298 0x71EF04AD) doors.exe DOORS: 001B:0051D3F8 (0x0012EEF0 0x71EF0509 0x1000E4A6 0x1000E49B) doors.exe DOORS: 001B:00F984D2 (0x71EF1A39 0x1000E4A6 0x1000E49B 0x08F9BCC8) doors.exe DOORS: 001B:008254F3 (0x00000008 0x08F9BCC8 0x00002458 0x08F9BCC8) doors.exe DOORS: **** end of event ****
SystemAdmin - Mon Oct 24 23:27:19 EDT 2011 |
Re: Request: removeLinkModuleDescriptor error when attempting to implement func
The Diagnostic log is useless; except by someone who is familiar with the details of the doors.exe. Its existance is interesting. Far more useful is the DXL error that would point you to the getSourceName() line of code.
Skip skp = create()
for LMD in Folder
{ if I want to delete then put(skp, LMD, LMD)
}
for LMD in skip
{ get source and target from LMD
removeLinkModuleDescriptor(fol, modSource,modTarget)
}
delete(skp)
Done = false
while(!Done)
{ Done = true
for LMD in fold do
{ if I want to delete this LMD)
{ Done = false
delete(LMD)
break
}
}
}
for (i=0; i<10; i++)
{ for (i=0; i<100; i++)
{}
}
Mom is right: don't mess with loop control inside the loop.
|
Re: Request: removeLinkModuleDescriptor error when attempting to implement func
Thank you for the help.
if (!isEdit(linkSourcePath))
{ linkSourcePath = edit(fullName(source lr),false,true,true) }
Folder fol = getParentFolder (linkSourcePath)
removeLinkModuleDescriptor(fol, fullName(linkSourcePath), fullName(Source))
addLinkModuleDescriptor (fol, fullName(linkSourcePath), fullName(archiveModule), false, true, LinkModule, "")
Linkset ls = create(lm, fullName(linkSourcePath), fullName(archiveModule))
void InLinks(Object hObject, Object aObject)
{
// Follow the in-links from the selected object (hObject)
Object hInObj = null
ModName_ inModRef = null
LinkRef lr = null
Link in_Link = null
Module linkSourcePath = null
int Error = 0
// find the source (other end) of the in-link
for lr in hObject <- "*" do
{
// get the full path to the link source
// for in-links this is always in the other module
linkSourcePath = edit(fullName(source lr),false,true,true)
//check that the target Module still exists
if (null linkSourcePath) {continue}
// check that the returned path is valid
if (!isEdit(linkSourcePath))
{ linkSourcePath = edit(fullName(source lr),false,true,true) }
Folder fol = getParentFolder (linkSourcePath)
removeLinkModuleDescriptor(fol, fullName(linkSourcePath), fullName(Source))
addLinkModuleDescriptor (fol, fullName(linkSourcePath), fullName(archiveModule), false, true, LinkModule, "")
Linkset ls = create(lm, fullName(linkSourcePath), fullName(archiveModule))
}
// now we know for sure those modules are open, we can do the real work
for in_Link in hObject <- "*" do
{
// check the module at the other end of the link
inModRef = source in_Link
if (null inModRef) {continue}
// check the object at the other end of the link
hInObj = source in_Link
if (null hInObj) {continue}
if (isDeleted(hInObj)) {continue}
//and finally do something useful with the source object
Error=createLink_(hInObj,LinkModule,aObject)
if (Error!=linkErrorNoError) { reportLinkError_(hInObj,aObject,LinkModule,"",Error) }
}
}
|
Re: Request: removeLinkModuleDescriptor error when attempting to implement func SystemAdmin - Tue Oct 25 18:15:14 EDT 2011
Thank you for the help.
if (!isEdit(linkSourcePath))
{ linkSourcePath = edit(fullName(source lr),false,true,true) }
Folder fol = getParentFolder (linkSourcePath)
removeLinkModuleDescriptor(fol, fullName(linkSourcePath), fullName(Source))
addLinkModuleDescriptor (fol, fullName(linkSourcePath), fullName(archiveModule), false, true, LinkModule, "")
Linkset ls = create(lm, fullName(linkSourcePath), fullName(archiveModule))
void InLinks(Object hObject, Object aObject)
{
// Follow the in-links from the selected object (hObject)
Object hInObj = null
ModName_ inModRef = null
LinkRef lr = null
Link in_Link = null
Module linkSourcePath = null
int Error = 0
// find the source (other end) of the in-link
for lr in hObject <- "*" do
{
// get the full path to the link source
// for in-links this is always in the other module
linkSourcePath = edit(fullName(source lr),false,true,true)
//check that the target Module still exists
if (null linkSourcePath) {continue}
// check that the returned path is valid
if (!isEdit(linkSourcePath))
{ linkSourcePath = edit(fullName(source lr),false,true,true) }
Folder fol = getParentFolder (linkSourcePath)
removeLinkModuleDescriptor(fol, fullName(linkSourcePath), fullName(Source))
addLinkModuleDescriptor (fol, fullName(linkSourcePath), fullName(archiveModule), false, true, LinkModule, "")
Linkset ls = create(lm, fullName(linkSourcePath), fullName(archiveModule))
}
// now we know for sure those modules are open, we can do the real work
for in_Link in hObject <- "*" do
{
// check the module at the other end of the link
inModRef = source in_Link
if (null inModRef) {continue}
// check the object at the other end of the link
hInObj = source in_Link
if (null hInObj) {continue}
if (isDeleted(hInObj)) {continue}
//and finally do something useful with the source object
Error=createLink_(hInObj,LinkModule,aObject)
if (Error!=linkErrorNoError) { reportLinkError_(hInObj,aObject,LinkModule,"",Error) }
}
}
I would suppose that has you created links to your archived module you would keep track in a skip list the names of all the LinkModules you used a long the way. When done creating links you now want to remove the old linksets. Open each LinkModule edit, loop through all its "Objects", convert each objects to a "Linkset": ... Linkset ls = linkset(Object ls) Then use the various LinkSet commands to see if this linkset involves your retired source module, and if so delete it. Then save the link module.
Seems to me you would want to query the existing LMD as to its particular properties, then apply those properties to the new LMD; specifically its Mandatory and Overrideable flags. I guess its OK to keep deleting and creating things you have already deleted and created but it gives me the hee-bee-gee-bees. I would find all the Linksets in the source module, for each create the corresponding linkset for the archive module, create the corresponding LMD to the archive module. Then plow through the objects creating all the links. When done, delete the old linksets and old LMDs. This approach lets you find and trap and resolve errors before the critical part of the code (deleting links), such as when you lack W access to the link module. |